-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][ADD] base_import_pdf_by_template_account: New module #1056
[17.0][ADD] base_import_pdf_by_template_account: New module #1056
Conversation
Ping @pedrobaeza What do you think about this approach? |
base_import_pdf_by_template/models/baseimportpdfbytemplate_mixin.py
Outdated
Show resolved
Hide resolved
5f1ae25
to
873ec82
Compare
3e23634
to
b98e98b
Compare
It's ready to review. |
Remove WIP tag from PR title |
/> | ||
<field name="column">3</field> | ||
<field name="value_type">fixed</field> | ||
<!--<field name="fixed_value_text">{"cls.env.ref('base_import_pdf_by_template_account.analytic_account_tecnativa').id": 100.0}</field>!--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is necessary but it is commented because it is not possible to do that directly. If you know the way to do it, it will be welcome! (this is currently set correctly in tests).
b98e98b
to
f7b7e33
Compare
ce86bdf
to
a59260d
Compare
Better to not use demo data on tests, as already stated in other PRs. |
So in all tests we create everything related to a template again? I do not agree that this is useful in the OCA modules (I am not sure it is an “official” guideline either.). |
You have to test the specific gestures of this module, not an entire template, and yes, what's needed for that tests should be in the test itself. |
Sorry, but how is the As a personal reflection, i think that all this "bureaucracy" is not good and will only demotivate some contributors. |
This is not bureaucracy. It's doing tests the best way. I already stated the reasons to not use demo data in other PR. Do you remember? I'm not saying here to not use templates. What I'm saying is that you don't need a whole template, just the minimal data to test the features. And all of that definitions inside the test class, not as demo data. |
Yes, and I explained then that I disagreed on the arguments. I explained earlier that you moved the demo data from |
You said that you don't agree, and then I'll explain the reasons, but you didn't counter-argument my explanations to say why it's better to use demo data. Odoo itself has moved to be demo-data independent because of these reasons. |
It was not worth counter-argument, just like now, it is simply better to make the changes you suggest and that's it. |
OK, we have debated about this internally. Just for others reading this, there's a guideline about this: Let's change it for avoiding problems in the future. |
dad9ea1
to
b89a01f
Compare
Extra commit added (and many lines) to define data in tests (without using demo data). Do you want that change also made to |
Do you really need the supplierinfo for all the products? When I talked about doing the minimal template in tests, I was referring to that, to have the minimal test unit, not a PDF template with lots of lines that are the same (but with another product). I don't want to bother you more in this one, but it's for you to take that into consideration. Always design the tests with the minimum use case, not a one with a lot of things repeated, but that are not adding real value to the test, just boilerplate creating more data, but testing the same feature. |
This is importing an existing .pdf file created specifically for that template (it was created some time ago), you can create another one specifically for the tests, but it would not make sense (or at least not to me), precisely for this reason I did not see sense to make this change. |
Well, even if using this not so ideal template, I think you can create just one product with full data, and another "fake one" that you put as fallback in case the product is not found for the rest of the lines. Or is there any exception in that case? |
The test was intended to validate a multi-line use case with different quantities, prices, etc, but if you want we can change it... (I don't understand that these comments appear on unrelated things, i.e. the test already existed and was validated). |
04ea251
to
c5b7a46
Compare
TT50003 [IMP] base_import_pdf_by_template_account: Improve tests (analytic distribution) TT50003
…t use demo data) TT50003
c5b7a46
to
4569fb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ocabot merge patch
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 4b32eeb. Thanks a lot for contributing to OCA. ❤️ |
New module
Locked by:
pdf_helper
: [17.0][FIX] pdf_helper: Odoo compatibility #1057Please @pilarvargas-tecnativa can you review it?
@Tecnativa TT50003